package artid.com.arttogo.bean;

import org.json.JSONObject;
import java.io.Serializable;

/**
 * 类描述： 支付返回解析+实体类
 * 创建人： 耿卫斌
 * 创建时间:2017/5/3 14:38
 */
public class MoneyPayParser extends AppItem implements Serializable{
    private String appid;//应用ID
    private String noncestr;//随机字符串
    private String partnerid;//商户号
    private String prepayid;//预支付交易会话ID
    private String timestamp;//时间戳
    private String sign;//签名
    private String packages;//扩展字段
    private String url;//支付宝支付回调接口
    private String pay_sn;//支付宝支付订单号
    private int state;//	0失败，1成功
    @Override
    public void parse(JSONObject obj) {
        if (null == obj) {
            return;
        }
        appid = obj.optString("appid");
        noncestr = obj.optString("noncestr");
        partnerid = obj.optString("partnerid");
        prepayid = obj.optString("prepayid");
        timestamp = obj.optString("timestamp");
        sign = obj.optString("sign");
        packages = obj.optString("packages");
        state = obj.optInt("state");
    }

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getNoncestr() {
        return noncestr;
    }

    public void setNoncestr(String noncestr) {
        this.noncestr = noncestr;
    }

    public String getPartnerid() {
        return partnerid;
    }

    public void setPartnerid(String partnerid) {
        this.partnerid = partnerid;
    }

    public String getPrepayid() {
        return prepayid;
    }

    public void setPrepayid(String prepayid) {
        this.prepayid = prepayid;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getPackages() {
        return packages;
    }

    public void setPackages(String packages) {
        this.packages = packages;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getPay_sn() {
        return pay_sn;
    }

    public void setPay_sn(String pay_sn) {
        this.pay_sn = pay_sn;
    }

    public MoneyPayParser() {
    }

    public MoneyPayParser(String appid, String noncestr, String partnerid, String prepayid, String timestamp, String sign, String packages, String url, String pay_sn, int state) {
        this.appid = appid;
        this.noncestr = noncestr;
        this.partnerid = partnerid;
        this.prepayid = prepayid;
        this.timestamp = timestamp;
        this.sign = sign;
        this.packages = packages;
        this.url = url;
        this.pay_sn = pay_sn;
        this.state = state;
    }

    @Override
    public String toString() {
        return "MoneyPayParser{" +
                "appid='" + appid + '\'' +
                ", noncestr='" + noncestr + '\'' +
                ", partnerid='" + partnerid + '\'' +
                ", prepayid='" + prepayid + '\'' +
                ", timestamp='" + timestamp + '\'' +
                ", sign='" + sign + '\'' +
                ", packages='" + packages + '\'' +
                ", url='" + url + '\'' +
                ", pay_sn='" + pay_sn + '\'' +
                ", state=" + state +
                '}';
    }
}
